{extends file="../acp.html"}

{block name="title"}{$head_title}{/block}
{block name="css"}
<link rel="stylesheet" href="/Public/Css/acp/AcpRole/add_role.css" type="text/css" />
<style>
    .add-role-list ul li{
        width:auto;
    }
</style>
{/block}
{block name="content"}
<form id='add_role_form' action='' name="add_role_form" method='POST'>
<div class="formitems inline">
    <label class="fi-name"><span class="colorRed">*</span>频道名称：</label>
    <div class="form-controls">
        <input type="text" name='channel_name' value='{$channel.channel_name}' placeholder="">
        <span class="fi-help-text"></span>
    </div>
</div>

<div class="formitems inline">
    <label class="fi-name"><span class="colorRed">*</span>频道栏目：</label>
    <div class="form-controls">
        <select name="channel_sort" id="">
            <option value="">--请选择频道栏目--</option>
            {foreach from=$channel_sort_list item=v}
            <option value="{$v.channel_sort_id}" {if $channel.sort_id == $v.channel_sort_id}selected{/if}>{$v.channel_sort_name}</option>
            {/foreach}
        </select>
        <span class="fi-help-text"></span>
    </div>
</div>

<div class="formitems inline">
    <label class="fi-name"><span class="colorRed">*</span>频道类型：</label>
    <div class="form-controls">
        <select name="channel_type" id="" {if $act == 'edit'}disabled="true"{/if}>
            <option value="">--请选择频道类型--</option>
            {foreach from=$channel_type item=v key=k}
            <option value="{$k}" {if $channel.channel_type == $k}selected{/if}>{$v}</option>
            {/foreach}
        </select>
        <span class="fi-help-text"></span>
    </div>
</div>
    <!--wangtao 2017.9.15 -start-->
<div class="formitems inline">
    <label class="fi-name"><span class="colorRed">*</span>频道默认分成：</label>
    <div class="form-controls">
        <input type="text" placeholder="" name="channel_rates" id="channel_rates" value="{$channel.channel_rates}">
        <span class="fi-help-text"></span>
    </div>
</div>
    <!--wangtao 2017.9.15 -end-->
<div class="formitems inline">
    <label class="fi-name"><span class="colorRed">*</span>排序：</label>
    <div class="form-controls">
        <input type="text" name='serial' value='{$channel.serial}' placeholder="">
        <span class="fi-help-text"></span>
    </div>
</div>

<div class="formitems inline">
    <label class="fi-name">显示：</label>
    <div class="form-controls">
        <div class="radio-group">
            <label><input type="radio" name="isuse" value="1" {if $channel.isuse == 1}checked="checked"{/if} />是</label>
            <label><input type="radio" name="isuse" value="0" {if $channel.isuse == 0}checked="checked"{/if} />否</label>
        </div>
    </div>
</div>

{upload_image_widget($class_img_data)}

<div class="formitems inline">
    <label class="fi-name"><span class="colorRed">*</span>频道简介：</label>
    <div class="form-controls">
        <textarea name="summary" >{$channel.summary}</textarea>
        <span class="fi-help-text"></span>
    </div>
</div>
<div class="formitems inline">
    <label class="fi-name">频道访问权限：</label>
    <div class="add_role_box">
                <div class="add-role-list">
                    <div class="add-role-tit">
                        <input type="checkbox" name="visit_all" id="visit_all" value="1" class="che-t" {if $channel.all_visit}checked{/if} />
                        <label for="checkbox_all">全部</label>
                    </div>
                    <ul>
                        {foreach from=$title_list item=v}
                        <li><input type="checkbox" name="visit_id[]" id="v_{$v.title_id}" class="che-li" value="{$v.title_id}" {if $channel.all_visit || in_array($v.title_id, $visit_priv)}checked{/if} /><label for="v_{$v.title_id}">{$v.title_name}</label></li>
                        {/foreach}
                    </ul>
                </div>
            <span class="fi-help-text"></span>
    </div>   
</div>

<div class="formitems inline">
    <label class="fi-name">频道发帖权限：</label>
    <div class="add_role_box">
                <div class="add-role-list">
                    <div class="add-role-tit">
                        <input type="checkbox" name="post_all" id="post_all" value="1" class="che-t" {if $channel.all_post}checked{/if}/>
                        <label for="checkbox_all">全部</label>
                    </div>
                    <ul>
                        {foreach from=$title_list item=v}
                        <li><input type="checkbox" name="post_id[]" id="p_{$v.title_id}" class="che-li" value="{$v.title_id}" {if $channel.all_post || in_array($v.title_id, $post_priv)}checked{/if} /><label for="p_{$v.title_id}">{$v.title_name}</label></li>
                        {/foreach}
                    </ul>
                </div>
            <span class="fi-help-text"></span>
    </div>   
</div>

<div class="formitems inline">
    <label class="fi-name"></label>
    <div class="form-controls">
    	<input type='hidden' name='act' value='{$act}' />
        <input type='hidden' name='channel_id' value='{$channel.channel_id}' />
        <button type="submit" class="btn btn-blue"><i class="gicon-check white"></i>确定</button>
    </div>
</div>
</form>
{/block}

{block name="js"}
<script src="/Public/Plugins/My97DatePicker/WdatePicker.js?version={$version}"></script>
<script>
{literal}
$(".che-t").click(function(){
    $(this).parents(".add-role-list").find("input:checkbox").attr("checked",this.checked);
})
{/literal}
</script>
{/block}


